{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li {if $id==''}class="active"{/if}><a {if $id==''}href="javascript:void(0);"{else}href="{$add_url}"{/if}><i class="glyphicon glyphicon-plus"></i> 添加管理员</a></li>
					<li><a href="{$index_url}" ><i class="glyphicon glyphicon-th-list"></i> 管理员列表</a></li>
					{if $id != ''}<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-edit"></i> 编辑管理员</a></li>{/if}

				</ul>
				<div class="inner-container">
					<form role="form" class="content-add-form" id="content-add-form" autocomplete="off">


						

						<!-- input -->
						<div class="form-group">
							<label >
								<span class="asterisk">*</span>
								登录账号
							</label>
							<input  dtype="" class="form-control" maxlength="20" name="data[username]" placeholder="用户名" required cname="用户名" value="{$item[username]}" />
						</div>
						<p class="help-block"></p>
						
						<!-- password -->
						<div class="form-group">
							<label>
								{if $id==''}
								<span class="asterisk">*</span>
								{/if}
								登录密码
							</label>
							<input  {if $id==''}required{/if} dtype="pwd" maxlength="20" type="password" placeholder="密码" name="data[password]" id="inputpassword" class="form-control">
							{if $id!=''}留空表示不修改{/if}
						</div>
						<p class="help-block"></p>
						<div class="form-group">
							<label>
								{if $id==''}
								<span class="asterisk">*</span>
								{/if}
								确认密码
							</label>
							<input  {if $id==''}required{/if} dtype="pwd" maxlength="20" type="password" placeholder="确认密码" name="data[re_password]" class="form-control" value="">
						</div>
						<p class="help-block"></p>
						<div class="form-group">
							<label >
								<span class="asterisk">*</span>
								姓名
							</label>
							<input  dtype="" class="form-control" maxlength="16" name="data[name]" placeholder="姓名" required cname="姓名" value="{$item[name]}" />
						</div>
						<p class="help-block"></p>
						<!-- input -->
						<div class="form-group">
							<label >
								用户工号
							</label>
							<input  dtype="" class="form-control" maxlength="12" name="data[jobno]" placeholder="工号"  cname="工号" value="{$item[jobno]}" />
						</div>
						<p class="help-block"></p>
						<!--tmpl-fields-->
						<div class="form-group">
							<label >
								<span class="asterisk">*</span>
								联系方式(手机)
							</label>
							<input  required dtype="mobile" class="form-control" maxlength="11" name="data[mobile]" placeholder="联系方式"  cname="联系方式" value="{$item[mobile]}" />
						</div>
						<p class="help-block"></p>
						

						
						<!-- input -->
						<div class="form-group">
							<label >
								E-Mail
							</label>
							<input  dtype="email" class="form-control" maxlength="100" name="data[email]" placeholder="电子邮箱"  cname="电子邮箱" value="{$item[email]}" />
						</div>
						<p class="help-block"></p>

						<div class="form-group">
							<label>角色</label>
							<select class="form-control m-bot15 " id="inputrole_id" name="data[role_id]">
								{if $myInfo['role_id'] == 0}
								<option value="0">超级管理员</option>
								{/if}
								<!--tmpl-options-->
								<!-- selectoptions -->
								{loop $role_idoptions $v}
								<option {if $item[role_id] == $v[id]}selected{/if} value="{$v[id]}">{$v[name]}</option>
								{/loop}
								
						
							</select>
						</div>
						<p class="help-block"></p>

						<div class="form-group">
							<label>账户状态</label>
							<div>
								<input type="checkbox" id="switch-status" name="data[status]" class="bswitch" data-size="normal" {if $item[status] || !isset($item)}checked{/if} data-on-text="正常" data-off-text="禁用">
							</div>
						</div>


						<!--tmpl-assocfields-->

						<!-- assocfield -->
						<!-- <div class="form-group" id="box-admin_role">
							<label >角色</label>
							<div class="input-group">
								<input type="input" class="form-control" name="assoc-admin_role" id="assoc-admin_role" >
								<span class="input-group-btn">
									<input type="button" class="btn btn-warning" value="选择" id="assoc-search-admin_role">
								</span>
							</div>
							<ul class="assocul" id="assoc-ul-admin_role">
							</ul>
						</div>
						-->
			

						<div class="btn-group btn-group-or">
							<a href="{if $id==''}{$do_add_url}{else}{$do_edit_url}?id={$id}{/if}" class="btn btn-primary ajaxproxy"
								proxy='{"method":"post", "location":"{$index_url}"}'>提交保存</a>

						</div>
					</form><!-- content add form -->
				</div>
			</div><!-- end of inner -->
		</section>
	</div>
</div>
{include admin.inc.footer}

<!--tmpl-script-->

<!-- assocalert -->
<script id="admin_role-assoc-box" type="text/html">
<div class="assoc-alertbox">
	<div class="searchbar">
		<form class="assoc-foreign-form form-inline">
			<!--tmpl-search-->

			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						角色名称
					</div>
					<input type="text" class="form-control input-sm" maxlength="50" placeholder="" name="s_name" value="{$s_name}">
				</div>
			</div>
			<input type="hidden" name="order" value="{$order}">
			<input type="btn" class="btn btn-sm btn-success assoc-search-btn" value="搜索"/>
		</form>
	</div>
	<div class="content">
	
	</div>
	<div class="paginate">

	</div>
</div>
</script>

<!-- assoclist -->
<script id="admin_role-assoc-tablelist" type="text/html">
<table class="table  table-condense">
	<tr>
		<th><input type="checkbox" id="assoc-selectall" ></th>
		<!--tmpl-th-->
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th>AppId</th>
	</tr>
	{[each items]}
	<tr>
		<td><input type="checkbox" name="assoc[]" value="{[$value.id]}"></td>
		<!--tmpl-td-->
		<td>{[$value.name]}</td>
		<td>{[$value.role_key]}</td>
		<td>{[$value.remark]}</td>
		<td>{[$value.addtime]}</td>
		<td>{[$value.edittime]}</td>
		<td>{[$value.admin_manager_id]}</td>
		<td>{[$value.del_status]}</td>
		<td>{[$value.app_id]}</td>
	</tr>
	{[/each]}
</table>
</script>



<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/admin_manageradd",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->

		parameter.admin_role_assoc_url="{$admin_role_assoc_url}";

		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[each pages]}
			<li ><a class="assoc-page" data-page="{[$value]}" {[if curr == $value]}class="active"{[/if]} href="javascript:void(0)">{[$value]}</a></li> 
		{[/each]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>

</body>
</html>
